<html>
<head><meta charset="utf-8"><title>Use of diagnostic items (discussion from rust#87170) · t-compiler/wg-diagnostics · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/index.html">t-compiler/wg-diagnostics</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html">Use of diagnostic items (discussion from rust#87170)</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246219798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246219798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246219798">(Jul 16 2021 at 13:05)</a>:</h4>
<p>Hey, there has been a discussion in <a href="https://github.com/rust-lang/rust/issues/87170">rust#87170</a> if each function should really have it's own diagnostic item. This is a breakdown of the main points:</p>
<p>The topic was initially (to my knowledge) raised <a href="#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/Diagnostic.20Item.20Naming.20Convention.3F/near/225024603">here</a> by <span class="user-mention" data-user-id="360405">@Cameron Steffen</span> who suggested to have a util function like <code>is_diagnostic_assoc_item(did, sym::Iterator, sym::map)</code> to find methods for diagnostic items.</p>
<p>It was the suggested to add diagnostic items to some modules like <code>cmp</code>, <code>mem</code> and <code>iter</code> to not have a diagnostic item for each function in them. This raised a concern that this would work against the idea of diagnostic items as they would be used again to build paths which we want to avoid. (See <a href="https://github.com/rust-lang/rust/issues/87170">rust#87170</a> for a more detailed breakdown)</p>
<p>I then suggested to not use a system based on diagnostic items but instead reuse the path resolution already present in rust that is normally used:</p>
<blockquote>
<p>My understanding is that paths in use statements resolve to the original <code>DefId</code> even if the item has been reexported. This would allow the usage of these for diagnostics without knowing the internal design of these crates. Example: <code>lookup("std::iter::repeat")</code> would return the <code>DefId</code>for <code>core::iter::sources::repeat::repeat</code> as that is also the function that is being called when the user uses <code>use std::iter::repeat</code>.</p>
<p>Has there been any previous discussions about a concept like this?</p>
</blockquote>
<p>cc: <span class="user-mention" data-user-id="360405">@Cameron Steffen</span>, <span class="user-mention" data-user-id="124288">@oli</span> <span class="user-mention" data-user-id="132040">@Manish Goregaokar</span> and <span class="user-group-mention" data-user-group-id="3456">@T-clippy</span></p>



<a name="246219976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246219976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246219976">(Jul 16 2021 at 13:07)</a>:</h4>
<p>I think there is agreement to not add diag items for associated items of traits and structs.</p>



<a name="246220050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246220050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246220050">(Jul 16 2021 at 13:08)</a>:</h4>
<p>I don't know how we could do it without diagnostic items. The DefId of an item at Clippy compile-time is not the same as the DefId at Clippy run-time.</p>



<a name="246220150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246220150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246220150">(Jul 16 2021 at 13:08)</a>:</h4>
<p>I think we gave up on the "just let name resolution figure it out" scheme, as no one knows how to make name resolution do that</p>



<a name="246220408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246220408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246220408">(Jul 16 2021 at 13:11)</a>:</h4>
<p>I think runtime name resolution is too costly anyways. You're doing X resolutions * Y nodes.</p>



<a name="246220457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246220457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246220457">(Jul 16 2021 at 13:11)</a>:</h4>
<p>we could probably cache it. We used to do a path resolution, and it was fast enough</p>



<a name="246220681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246220681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246220681">(Jul 16 2021 at 13:14)</a>:</h4>
<p>A similar resolution has to be done currently as well, it would surprise me if that would make a big difference to use runtime name resolution. And that's not taking caching into a count</p>



<a name="246221181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246221181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246221181">(Jul 16 2021 at 13:18)</a>:</h4>
<p>We're doing 1 or 2 <code>tcx.parent</code> calls which is not as much as traversing a path of 10 elements or so.</p>



<a name="246221259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246221259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246221259">(Jul 16 2021 at 13:19)</a>:</h4>
<p>caching SGTM</p>



<a name="246221336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246221336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246221336">(Jul 16 2021 at 13:19)</a>:</h4>
<p>it would be nice if there were some way for Clippy to cache data without adding a feature to rustc</p>



<a name="246222117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246222117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246222117">(Jul 16 2021 at 13:26)</a>:</h4>
<p>I'll see if I can somehow dig up how paths are resolved in an accessible manner to Clippy. I would say we can look at performance/caching then <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="246222250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246222250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246222250">(Jul 16 2021 at 13:27)</a>:</h4>
<p>maybe some day we should rewrite clippy on top of rust analyzer <span aria-label="grinning" class="emoji emoji-1f600" role="img" title="grinning">:grinning:</span></p>



<a name="246222464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246222464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246222464">(Jul 16 2021 at 13:29)</a>:</h4>
<p>Clippy's homegrown path resolution is <code>path_to_res</code>. I suspect we would ultimately still have something like that rather than hooking into rustc's name resolution.</p>



<a name="246222794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246222794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246222794">(Jul 16 2021 at 13:31)</a>:</h4>
<p>Could you explain why <span class="user-mention" data-user-id="360405">@Cameron Steffen</span>, wouldn't it be better to reuse the same code that rustc uses? <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="246222904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246222904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246222904">(Jul 16 2021 at 13:32)</a>:</h4>
<p>I suppose, but I looked at it one time and got scared</p>



<a name="246222979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246222979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246222979">(Jul 16 2021 at 13:33)</a>:</h4>
<p><span class="user-mention silent" data-user-id="369415">xFrednet</span> <a href="#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/Use.20of.20diagnostic.20items.20.28discussion.20from.20rust.2387170.29/near/246222794">said</a>:</p>
<blockquote>
<p>Could you explain why <span class="user-mention silent" data-user-id="360405">Cameron Steffen</span>, wouldn't it be better to reuse the same code that rustc uses? <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>
</blockquote>
<p>it may not be possible at all, it's deeply entangled in the compiler and not usable afterwards as rustdoc has painfully found out</p>



<a name="246222999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246222999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246222999">(Jul 16 2021 at 13:33)</a>:</h4>
<p>so... if you do anything here, coordinate with rustdoc</p>



<a name="246223016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246223016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246223016">(Jul 16 2021 at 13:33)</a>:</h4>
<p>I think it's very complex because it has to work with paths to items that are not yet seen/compiled</p>



<a name="246223377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246223377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246223377">(Jul 16 2021 at 13:36)</a>:</h4>
<p>Okay, it seem's like I've underestimated the complexity of the system again <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> I'll have a look at it, also how rustdoc does it, thank you for the pointers! <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="246223450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246223450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246223450">(Jul 16 2021 at 13:37)</a>:</h4>
<p>Soo we could basically throw <code>path_to_res</code> into a query right?</p>



<a name="246223477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246223477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246223477">(Jul 16 2021 at 13:37)</a>:</h4>
<p><code>&amp;[Symbol] -&gt; Option&lt;DefId&gt;</code></p>



<a name="246223505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246223505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246223505">(Jul 16 2021 at 13:37)</a>:</h4>
<p>or Res, whatever</p>



<a name="246223511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246223511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246223511">(Jul 16 2021 at 13:37)</a>:</h4>
<p><code>path_to_res</code> is the wrong thing. It resolves to the absolute path. Which can change randomly between platforms and when libstd is changed</p>



<a name="246223528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246223528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246223528">(Jul 16 2021 at 13:37)</a>:</h4>
<p>that's why we moved to diagnostic items</p>



<a name="246223713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246223713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246223713">(Jul 16 2021 at 13:39)</a>:</h4>
<p>No <code>path_to_res</code> works with non-absolute paths. We have both.</p>



<a name="246223938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246223938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246223938">(Jul 16 2021 at 13:41)</a>:</h4>
<p>The idea would be to use the path that is exposed to the user like: <code>std::iter::repeat</code> even if that ends up somewhere completely different</p>



<a name="246223990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246223990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246223990">(Jul 16 2021 at 13:41)</a>:</h4>
<p>right</p>



<a name="246243379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246243379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246243379">(Jul 16 2021 at 16:05)</a>:</h4>
<p>Please do not clone the resolver</p>



<a name="246243433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246243433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246243433">(Jul 16 2021 at 16:06)</a>:</h4>
<p>It causes ICEs, I've spent like 6 months trying to fix it unsuccessfully</p>



<a name="246243511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246243511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246243511">(Jul 16 2021 at 16:06)</a>:</h4>
<p>Either resolve things ahead of time (which is hard because all the APIs are different and you don't have access to a tcx) or use diagnostic items or whatever</p>



<a name="246247461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Use%20of%20diagnostic%20items%20%28discussion%20from%20rust%2387170%29/near/246247461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Use.20of.20diagnostic.20items.20(discussion.20from.20rust.2387170).html#246247461">(Jul 16 2021 at 16:38)</a>:</h4>
<p>I was hoping that we could reuse the resolver somehow. From the feedback here and on GH it seems like diagnostic items are a way better solution (and that's probably why the decision was made to introduce them^^). I'll still look a bit into it and toy around with it, but it seems like that is not worth to pursue, especially if it could produce avoidable ICEs</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>